<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script>
	function fun(n){
		if(n==1) return n;
		else return n*fun(n-1);
	}
	var n=prompt("请输入一个大于1的正整数",5);
	n= parseInt(n);
	if (isNaN(n)) {
		alert("输入数据不合法！");
	} else{
		document.write(n+"！="+fun(n));
	}
</script>